import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

public class Test2 {
    public static void main(String[] args) throws InterruptedException {
        BlockingQueue<String> bqueue=new LinkedBlockingQueue<>();
        bqueue.put("111");
        bqueue.put("222");
        bqueue.put("333");

        String elem=bqueue.take();
        System.out.println(elem);
        elem=bqueue.take();
        System.out.println(elem);
        elem=bqueue.take();
        System.out.println(elem);
        elem=bqueue.take();
        System.out.println(elem);
    }
}
